package com.freemalll.merchant.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.freemalll.merchant.domain.dto.MerAttachDto;
import com.freemalll.merchant.domain.entity.MerAttach;
import com.freemalll.merchant.domain.vo.MerAttachCheckVO;
import com.freemalll.merchant.domain.vo.MerAttachVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 映射层。
 *
 * @author songshixiong
 * @since 2025-05-22
 */
@Mapper
public interface MerAttachMapper extends BaseMapper<MerAttach> {


    List<MerAttachDto> selectBuJianAttachList(@Param("merId") String merId);


    List<MerAttachDto> listHistoryByMerId(@Param("merId") String merId);


    List<MerAttachVO> getLatestAttachByMerId(@Param("merId") String merId);

    /**
     * 根据商户id和附件类型查询最新附件
     * @param merId
     * @param attachTypeList
     * @return
     */
    List<MerAttach> getLatestAttachByMerIdAndAttachType(@Param("merId") String merId, @Param("attachTypeList") List<Integer> attachTypeList);


    List<MerAttachCheckVO> listCheckListByMerId(@Param("merId") String merId);

    String selectAttachByMerIdAndConfigCode(@Param("merId") String merId, @Param("configCode") String configCode);

    /**
     * 根据商户id和附件类型查询附件列表
     *
     * @param merId
     * @param attachType
     * @return
     */
    List<MerAttachDto> queryAttachListByOperate(@Param("merId") String merId, @Param("attachType") int attachType);


    List<String> selectByMerIdAndConfigCode(@Param("merId") String merId, @Param("configCode") String configCode);
}
